﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using System.IO;

namespace PPCodes.Log
{
    public sealed class FileLogger : Log4netBase
    {
        /// <summary>
        /// 获取日志类的实例
        /// </summary>
        public static FileLogger Instance;

        /// <summary>
        /// 使用指定的配置文件创建日志类的一个实例
        /// </summary>
        private FileLogger(string loggerName, FileInfo configFile, bool isWatch): base(loggerName, configFile, isWatch)
        {
        }

        /// <summary>
        /// 调用静态方法或属性时创建实例
        /// </summary>
        static FileLogger()
        {
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            Instance = new FileLogger("MyLog", new FileInfo(path + "LogSetting.config"), true);
        }

    }
}
